// components/load-prompt/index.js
Component({
  options: {
    addGlobalClass: true
  },

  /**
   * 组件的属性列表
   */
  properties: {
    state: {
      type: Object,
      value: {
        isFreshing: false,
        isPending: false,
        isError: false,
        error: {},
        isFirst: true
      }
    },
    loadingIcon: {
      type: String,
      value: ''
    },
    loadingSize: {
      type: String,
      value: '56rpx'
    },
    loadingText: {
      type: String,
      value: '加载中...'
    },
    moreText: {
      type: String,
      value: '上拉可加载更多'
    },
    fullHeight: {
      type: String,
      value: '100%'
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    onClick () {
      this.triggerEvent('retry', this.properties.state.error)
    }
  }
})
